package br.edu.ufcg.lsd.wbis.ui.client.ui.loggedin.admin.uppermenu.equipment;

import br.edu.ufcg.lsd.wbis.ui.client.beans.UserInfo;
import br.edu.ufcg.lsd.wbis.ui.client.ui.management.InfoManager;

import com.gwtext.client.widgets.TabPanel;
import com.gwtext.client.widgets.ToolbarButton;
import com.gwtext.client.widgets.menu.Item;
import com.gwtext.client.widgets.menu.Menu;

/**
 * @author Renato Miceli
 */
public class EquipmentToolbarButton extends ToolbarButton {

	public EquipmentToolbarButton(TabPanel centerPanel, InfoManager<UserInfo> infoManager) {

		this.setText("Equipments");

		final Menu equipmentsMenu = new Menu();
		equipmentsMenu.setShadow(true);
		equipmentsMenu.setMinWidth(10);
		this.setMenu(equipmentsMenu);

		equipmentsMenu.addItem(new AddEquipmentItem());
		equipmentsMenu.addItem(new ManageEquipmentsItem(centerPanel, infoManager));
		equipmentsMenu.addItem(new Item("Search Equipments"));
	}

}
